<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class SetupSettingsTable extends Migration {

    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        //
        Schema::create('settings', function($table)
        {
            $table->increments('id');
            $table->string('site_url',200)->nullable()->comment('网站地址');
            $table->string('company_name',200)->nullable()->comment('公司名称');
            $table->string('master_email',100)->nullable()->comment('管理员邮件地址');
            $table->string('address',200)->nullable()->comment('公司地址');
            $table->string('service_phone',50)->nullable()->comment('服务电话');
            $table->string('mobile',50)->nullable()->comment('手机号');
            $table->text('company_instroductions')->nullable()->comment('公司简介');


            $table->text('app_url')->nullable()->comment('微信的URL地址');
            $table->string('app_id',200)->nullable()->comment('AppID');
            $table->string('app_secret',200)->nullable()->comment('AppSecret');
            $table->string('access_token',200)->nullable()->comment('AccessToken');
            $table->integer('access_token_expires_in')->default(0)->comment('AccessToken 的到期时间');
            $table->decimal('integral_scale', 8, 2)->default(0.01)->comment('现金结算赠送积分比率， 100元＝1积分');
            $table->decimal('integral_pay_scale', 8, 2)->default(100.00)->comment('用积分结算比率，100积分＝1元');

            $table->timestamps();

        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
        Schema::drop('settings');
    }

}
